<?php

/**
 * @Author: user
 * @Date:   2018-11-07 09:41:58
 * @Last Modified by:   user
 * @Last Modified time: 2018-11-07 10:55:04
 */
namespace app\common\behavior;

use app\common\lib\user_operate\ModuleOperate;

/**
 * 
 */
class PluginMenulistHook
{
    public $pluginModuleId;

    public function run(&$params)
    {
        //如果开发中的
        if ($params['status'] != 4) {
            $params['state'] = empty($params['code']) ? false : true;
            return;
        }
        // $info = $params['info'];
        $moduleName = cmf_parse_name($params['name']);

        $MO = new ModuleOperate();

        $res             = $MO->installStatus($moduleName, $params['code']);
        $params['state'] = $res['status'];
    }
}
